package com.mrjy.maintain.controller;

import java.util.HashMap;
import java.util.Map;

import javax.servlet.http.HttpSession;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.mrjy.common.entity.RoleInfo;
import com.mrjy.maintain.bo.IRoleInfoBo;

@Controller
@RequestMapping("/maintain/roleInfo")
public class RoleInfoController {
	
	@Autowired
	private IRoleInfoBo roleInfoBo;
	
	/**
	 * 添加角色
	 * @return
	 */
	@RequestMapping("/insert")
	@ResponseBody
	public Object insert(RoleInfo roleInfo,HttpSession session){
		return roleInfoBo.insert(roleInfo,session);
	}
	
	
	/**
	 * 查询所有角色
	 * @return
	 */
	@RequestMapping("/queryAllRole")
	@ResponseBody
	public Object queryAllRole(){
		return roleInfoBo.queryAllRole();
	}
	
	/**
	 * 分页查询角色
	 * @return
	 */
	@RequestMapping("/queryByPage")
	@ResponseBody
	public Object queryByPage(RoleInfo roleInfo,HttpSession session){
		return roleInfoBo.queryByPage(roleInfo,session);
	}
	
	
	/**
	 * 修改
	 * @return
	 */
	@RequestMapping("/updateById")
	@ResponseBody
	public Object updateById(RoleInfo roleInfo,HttpSession session){
		return roleInfoBo.updateById(roleInfo,session);
	}
	
	/**
	 * 启用禁用
	 * @return
	 */
	@RequestMapping("/updateDisableFlag")
	@ResponseBody
	public Object updateDisableFlag(RoleInfo roleInfo,HttpSession session){
		return	roleInfoBo.updateDisableFlag(roleInfo,session);
	}
	
}
